<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="__STATIC__/js/jquery.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/bootstrap-table/js/bootstrap-table.js"></script>
    <script src="__STATIC__/bootstrap-table/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="__STATIC__/bootstrap-table/js/dropdown.js"></script>
    <link rel="stylesheet" href="__STATIC__/bootstrap-table/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="__STATIC__/bootstrap-table/css/bootstrap.css">
    <script type="text/javascript" src="__STATIC__/x-admin/js/xadmin.js"></script>
    <link rel="stylesheet" href="__STATIC__/x-admin/css/font.css">
    <link rel="stylesheet" href="__STATIC__/x-admin/css/xadmin.css">
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="#">资源管理</a>
        <a href="#">论文指导</a>
        <a href="#">论文管理</a>
        <a href="#">编辑论文</a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<form class="layui-form" id="paper" onsubmit="return false">
    <input name="id" value="{$data.id}" hidden type="text">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" value="{$data.title}" required  lay-verify="required" placeholder="{$data.title}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">正文</label>
            <div class="layui-input-block">
                <textarea name="content" placeholder="{$data.content}" class="layui-textarea">{$data.content}</textarea>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">作者</label>
        <div class="layui-input-block">
            <input type="text" name="author" required  value="{$data.author}" lay-verify="required" placeholder="{$data.author}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">来源网址</label>
        <div class="layui-input-block">
            <input type="text" name="url" required  value="{$data.url}" lay-verify="required" placeholder="{$data.url}" autocomplete="off" class="layui-input" >
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" id="add">修改</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
</html>
<script>
    $("#add").click(function(){
        $.ajax({
            type:"post",
            url:"{:url('/paper/upContent')}",
            dataType:"json",
            data:$("#paper").serialize(),
            success:function(res){
                if(res.code){
                    layer.msg(res.msg,{icon:1,time:2000},function(){
                        window.location.reload();
                    });
                    return;
                }else{
                    layer.msg(res.msg,{icon:5,time:2000});
                    return;
                }
            }
        })
    })
</script>